#include <iostream>
using namespace std;

float func(int n)
{
	if (n < 1)
		return 0.0;
	if (n == 1)
		return 1;
	int m = 1;
	float ret = 0;
	for (int i = 1; i <= n; i++)
	{
		float tmp = (float)1 / i;
		ret += m * tmp;
		m = -m;
	}
	return ret;
}






int main()
{/*
	cout << func(0) << endl;
	cout << func(1) << endl;
	cout << func(2) << endl;
	cout << func(5) << endl;*/



	float y(1);
	return 0;
}